package org.epidroid.epidroid.chronos.ui;

import android.graphics.Color;
import android.os.Parcelable;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.view.View;
import android.widget.TextView;

public class MyCompactViewAdapter extends PagerAdapter {

	private ChronosCompactViewActivity _activity = null;

	public MyCompactViewAdapter(ChronosCompactViewActivity activity) {
		_activity = activity;
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return 3;
	}

	@Override
	public void destroyItem(View collection, int position, Object view) {
		((ViewPager) collection).removeView((TextView) view);
	}

	@Override
	public boolean isViewFromObject(View view, Object object) {
		return view == ((TextView) object);

	}

	@Override
	public Object instantiateItem(View container, int position) {
		TextView tv = new TextView(_activity);
		tv.setText("Bonjour PAUG " + position);
		tv.setTextColor(Color.WHITE);
		tv.setTextSize(30);

		((ViewPager) container).addView(tv, 0);

		return tv;
	}
	
	@Override
    public void finishUpdate(View arg0) {}
    

    @Override
    public void restoreState(Parcelable arg0, ClassLoader arg1) {}

    @Override
    public Parcelable saveState() {
            return null;
    }

    @Override
    public void startUpdate(View arg0) {}


}
